﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;
using personalplaner.business.extensions;

namespace personalplaner.business.dienstplan.plancollection
{
	public class DayHeaderRow : ListBase<PlanItem>, IDienstPlanRow
	{
		#region IDienstPlanRow Members

		public void Initialize(DateTime beginDate, IList<PlanItem> items = null)
		{
			int cnt = DateTime.DaysInMonth(beginDate.Year, beginDate.Month);
			for (int i = 0; i < cnt; i++)
			{
				var date = new DateTime(beginDate.Year, beginDate.Month, i + 1);
				Add(new PlanItem
				    {
				    	Datum = date,
						Color = RowColor,
				    	Name = date.ShortDayOfWeek(),
						CanExecuteCommand = false
				    });
			}
		}

        int _prsId;
        public int PrsId
        {
            get
            {
                return _prsId;
            }
            set
            {
                _prsId = value;
                RaisePropertyChanged("PrsId");
            }
        }

		int _abteilungid;
		public int AbteilungId
		{
			get
			{
				return _abteilungid;
			}
			set
			{
				_abteilungid = value;
				RaisePropertyChanged("AbteilungId");
			}
		}

		string _abteilung;
		public string Abteilung
		{
			get
			{
				return _abteilung;
			}
			set
			{
				_abteilung = value;
				RaisePropertyChanged("Abteilung");
			}
		}

		int _planSchemaId;
		public int PlanSchemaId
		{
			get
			{
				return _planSchemaId;
			}
			set
			{
				_planSchemaId = value;
				RaisePropertyChanged("PlanSchemaId");
			}
		}

		public int? Pensum
		{
			get { return null; }
			set
			{
			}
		}

		#region Stunden Soll/Haben

		public double? Vortrag
		{
			get { return null; }
			set
			{
			}
		}

		public double? Soll
		{
			get { return null; }
			set
			{
			}
		}

		public double? Haben
		{
			get { return null; }
			set
			{
			}
		}

		public double? Anpassung
		{
			get { return null; }
			set
			{
			}
		}

		public double? Differenz
		{
			get { return null; }
		}

		#endregion

		#region Coloring

		Color _color;
		public Color RowColor
		{
			get
			{
				return _color;
			}
			set
			{
				_color = value;
				RaisePropertyChanged("RowColor");
			}
		}

		Color _headercolor;
		public Color HeaderColor
		{
			get
			{
				return _headercolor;
			}
			set
			{
				_headercolor = value;
				RaisePropertyChanged("HeaderColor");
			}
		}

		#endregion

		#endregion
	}
}
